<template>
  <div>
    <el-card>
      <div slot="header" class="header">
        <i
          class="el-icon-back"
          @click="
            $router.push({
              path: '/order',
            })
          "
        ></i>
        <!-- 订单编辑{{ form }} -->
      </div>
      <el-form :model="form">
        <el-form-item label="订单号：" label-width="120px">
          <el-input v-model="form.id" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="下单时间：" label-width="120px">
          <el-input v-model="form.orderTime" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="手机号：" label-width="120px">
          <el-input v-model="form.phone" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="收货人：" label-width="120px">
          <el-input v-model="form.orderNo" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="配速地址：" label-width="120px">
          <el-input v-model="form.deliverAddress" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="送达时间：" label-width="120px">
          <el-input v-model="form.deliveryTime" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="用户备注：" label-width="120px">
          <el-input v-model="form.remarks" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="订单金额：" label-width="120px">
          <el-input v-model="form.orderAmount" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="订单状态：" label-width="120px">
          <el-input v-model="form.orderState" autocomplete="off"></el-input>
        </el-form-item>
        <el-button type="primary" @click="handleSure">确 定</el-button>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import {editOrderReq} from '@/api/order'

export default {
  data() {
    return {
      form: {
        id: '',
        orderNo: '',
        orderTime: '',
        phone: '',
        consignee: '',
        deliverAddress: '',
        deliveryTime: '',
        remarks: '',
        orderAmount: '',
        orderState: '',
      },
    }
  },

  methods: {
    async getData() {
      let res = await editOrderReq({
        ...this.form,
      })
      console.log(res.data)
      this.form = res.data.data
    },

    // 确定保存
    handleSure() {},
  },
  created() {
    //获取传参
    this.form.id = this.$route.params.id
    // console.log(this.id);
    this.getData()
  },
}
</script>

<style lang="scss" scoped></style>
